package IOService;

import dao.CommodityDao;
import pojo.Commodity;
import pojo.CommodityList;

import java.util.Scanner;

public class SelectService implements IOService {
    @Override
    public void work(CommodityList commodityList) {
        Scanner sc=new Scanner(System.in);
        System.out.println("查找的物品");
        String commdityName=sc.nextLine();
        CommodityDao bookDao = new CommodityDao();
        Commodity select = bookDao.Select(commdityName);
        System.out.println(select);
//        for (int i=0;i<commodityList.getCommdityCount();i++){
//            Commodity commodity=commodityList.getCommodities(i);
//            if (commdityName.equals(commodity.getName()));{
//                System.out.println(commodity);
//                return;
//            }
//        }
    }
}
